package cn.wangwang.application;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * Created by Wangwang on 2017/11/23.
 */
@SpringBootApplication()
//@MapperScan("cn.wangwang.dao")
@Slf4j
@ComponentScan(basePackages = "cn.wangwang")
@EnableAutoConfiguration
public class MainApplication {

    //@Bean
    //@ConfigurationProperties(prefix = "datasource")
    //public DataSource dataSource() {
    //    log.info("start init dataSource");
    //    return new DataSource();
    //}
    //
    ////提供SqlSeesion
    //@Bean
    //public SqlSessionFactory sqlSessionFactoryBean() throws Exception {
    //
    //    SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
    //    sqlSessionFactoryBean.setDataSource(dataSource());
    //
    //    PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
    //
    //    sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:/sqlMapper/*.xml"));
    //
    //    return sqlSessionFactoryBean.getObject();
    //}

    //@Bean
    //public PlatformTransactionManager transactionManager() {
    //    return new DataSourceTransactionManager(dataSource());
    //}


    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }
}
